<template>
	<view class="template-transfer">



		<view class="" style="padding-bottom: 240rpx;">

			<picker @change="bindPickerChange" :value="index" :range="array">
			  <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-padding">
			    <view class="tn-flex justify-content-item">
			      <view class="tn-text-bold tn-text-lg">
			        文件类型
			      </view>
			    </view>
			    <view class="tn-flex justify-content-item tn-color-gray">
			      <view class="tn-padding-top">选择文件类型 <text class="tn-icon-right "></text></view>
			    </view>
			  </view>
			</picker>
			<view class="tn-flex tn-flex-row-between tn-flex-col-center tn-padding">
				<view class="tn-flex justify-content-item">
					<view class="tn-text-bold tn-text-lg">
						文件描述信息
					</view>
				</view>
			</view>
			
			<view class="tn-bg-gray--light tn-padding" style="border-radius: 10rpx;margin: 0 30rpx 30rpx 30rpx;">
				<textarea maxlength="500" placeholder="请输入文件描述" placeholder-style="color:#AAAAAA"
					style="height: 160rpx;"></textarea>
			</view>


			<view class="tn-flex tn-flex-row-between tn-flex-col-center tn-padding tn-strip-top">
				<view class="tn-flex justify-content-item">
					<view class="tn-text-bold tn-text-lg">
						上传附件 <text class="tn-color-red tn-padding-left-xs">*</text>
					</view>
				</view>
				<view class="justify-content-item tn-text-xl tn-color-grey">
					<view class="tn-icon-add-circle"></view>
				</view>
			</view>

			<view class="tn-margin-left tn-margin-right tn-margin-bottom"
				style="background-color: #00C8B008;color: #00C8B0;border-radius: 10rpx;" @click="tn('')">
				<view class="tn-flex tn-flex-row-between tn-flex-col-center tn-padding">
					<view class="justify-content-item tn-text-bold tn-text-left" style="width: 80%;">
						<view class="">
							<text class="">报销明细.xls</text>
						</view>
						<view class="tn-padding-top-xs tn-text-sm">
							<text class="tn-icon-folder-fill "></text>
							<text class="tn-padding-left-xs">109.23 KB</text>
						</view>
					</view>
					<view class="justify-content-item">
						<text class="tn-icon-close-fill"></text>
					</view>
				</view>
			</view>


			<!-- 悬浮按钮-->
			<view class="tn-flex tn-footerfixed tn-padding">
				<view class="tn-flex-1 justify-content-item tn-text-center">
					<tn-button backgroundColor="#00C8B0 " padding="40rpx 0" width="60%" :fontSize="28"
						fontColor="#FFFFFF" shape="round" @click="tn('')">
						<text class="">提交上传</text>
					</tn-button>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
	export default {
		name: 'TemplateTransfer',
		mixins: [template_page_mixin],
		data() {
			return {
				index: 99,
				array: ['日报', '周报', '月报', '单纯想汇报'],

				action: 'https://www.hualigs.cn/api/upload',
				// action: '',
				formData: {
					apiType: 'this,ali',
					token: 'dffc1e06e636cff0fdf7d877b6ae6a2e',
					image: null
				},
				fileList: [{
					url: 'https://cdn.nlark.com/yuque/0/2023/jpeg/280373/1694103619950-assets/web-upload/31e51c70-c0d4-4814-91d6-c740d45b014d.jpeg'
				}, {
					url: 'https://cdn.nlark.com/yuque/0/2023/jpeg/280373/1694103627372-assets/web-upload/4dbd5977-14d8-4720-9ec4-752ced51c39a.jpeg'
				}],
				showUploadList: true,
				customBtn: false,
				autoUpload: true,
				showProgress: false,
				deleteable: true,
				customStyle: false,
				maxCount: 6,
				disabled: false,
			}
		},
		methods: {
			bindPickerChange: function(e) {
				this.index = e.detail.value
			},
			// 跳转
			tn(e) {
				uni.navigateTo({
					url: e,
				});
			},

			// 手动上传文件
			upload() {
				this.$refs.imageUpload.upload()
			},
			// 手动清空列表
			clear() {
				this.$refs.imageUpload.clear()
			},
			// 图片拖拽重新排序
			onSortList(list) {
				console.log(list);
			},
		}
	}
</script>

<style lang="scss" scoped>
	.template-transfer {
		background-color: #FFFFFF;
	}

	/* 胶囊*/
	.tn-custom-nav-bar__back {
		width: 60%;
		height: 100%;
		position: relative;
		display: flex;
		justify-content: space-evenly;
		align-items: center;
		box-sizing: border-box;
		background-color: rgba(0, 0, 0, 0.15);
		border-radius: 1000rpx;
		border: 1rpx solid rgba(255, 255, 255, 0.5);
		color: #FFFFFF;
		font-size: 32rpx;

		.icon {
			display: block;
			flex: 1;
			margin: auto;
			text-align: center;
		}

	}

	/* 间隔线 start*/
	.tn-strip-bottom-min {
		width: 100%;
		border-bottom: 1rpx solid #F8F9FB;
	}

	.tn-strip-top {
		width: 100%;
		border-top: 20rpx solid rgba(241, 241, 241, 0.8);
	}

	/* 间隔线 end*/

	/* 底部悬浮按钮 start*/
	.tn-tabbar-height {
		min-height: 160rpx;
		height: calc(180rpx + env(safe-area-inset-bottom) / 2);
		height: calc(180rpx + constant(safe-area-inset-bottom));
	}

	.tn-footerfixed {
		position: fixed;
		width: 100%;
		bottom: calc(40rpx + env(safe-area-inset-bottom));
		z-index: 1;
		box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0);
	}

	/* 底部悬浮按钮 end*/
</style>
